from Base import message, intersect, SS_VALID
from DRG import MDCG_DRG

def group(record):
  adrg_zd = []
  adrg_zd1 = []
  adrg_ss = ["43.9906","40.5000","40.5200","42.5801","42.5802","42.5803","43.3x00x003","43.3x00x004","43.3x01","43.4201","43.4202","43.4203","43.6x00x005","43.6x00x006","43.6x01","43.6x02","43.7x00x001","43.7x00x002","43.7x01","43.7x02","43.7x03","43.8100","43.8202","43.8901","43.8902","43.8903","43.9101","43.9102","43.9900x002","43.9900x003","43.9900x004","44.2100x001","44.2200x002","44.2900x001","44.2900x003","44.2901","44.3801","44.3802","44.3803","44.3804","44.3900x003","44.3901","44.3902","44.3903","44.3904","44.6500","44.6500x003","44.6501","44.6600x002","44.6601","45.6200x005","45.6200x006","45.6203","51.8200x001","51.8200x002","51.8300x003","51.8301","52.6x01","52.7x00","52.7x00x003"]
  adrg_ss1 = []
  dept_list = []

  if True and record.ssList and record.ssList[0] in adrg_ss:
    message('符合GB2入组条件，匹配规则：主手术匹配')

    if MDCG_DRG.GB29_group(record):
      return 'GB29'
        
    return 'GB2'
  else:
    return ''
    
